

<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <form  id="report-form"  class="form-horizontal form-commonsearch nice-validator n-default n-bootstrap" novalidate="" role="form" method="post" action="">
            <fieldset>
                <div class="row">

                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('Dianchang_id')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-dianchang_id" data-rule="required" data-source="dianchang/index" class="form-control selectpage form-control" name="row[dianchang_id]" type="text" value="">
                        </div>
                    </div>


                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">日期范围:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-riqi" class="form-control datetimerange " data-date-format="YYYY-MM-DD" data-use-current="true" name="riqi" type="text" value="">
                        </div>
                    </div>


                    <div class="form-group col-md-12">
                        <div class="" style="float: right">
                            <button id="dosubmit" type="submit" class="btn btn-success" formnovalidate="">提交</button>
                            <button type="reset" class="btn btn-default">重置</button></div>
                    </div>
                </div>
            </fieldset>
        </form>
    </div>
    <div class="panel-body">

        <div class="row">

            <div id="echart" style="height:600px;width:100%;"></div>

        </div>


    </div>
</div>



<script>
    var data_url="{:url('report')}";
    option = {
        title : {
            text: '电厂:{$dianchang["name"]}电价图',
            subtext: '变化幅度'
        },
        tooltip : {
            trigger: 'axis'
        },
        legend: {
            data:['最高气温','最低气温']
        },
        toolbox: {
            show : true,
            feature : {
                mark : {show: true},
                dataView : {show: true, readOnly: false},
                magicType : {show: true, type: ['line', 'bar']},
                restore : {show: true},
                saveAsImage : {show: true}
            }
        },
        calculable : true,
        xAxis : [
            {
                type : 'category',
                boundaryGap : false,
                data : [
                    {volist name="riqi" id="vo"}'{$vo}',{/volist}

                ],
                axisLabel : {
                    formatter: null,
                    rotate: 30,
                    textStyle: {
                        color: '#333'
                    }
                }
            }
        ],
        yAxis : [
            {
                type : 'value',
                axisLabel : {
                   // formatter: '¥{value}',
                    formatter: function (value, index) {
                        return '¥'+value.toFixed(4);
                    }
                },
                scale:true,

            }
        ],
        series : [
            {
                name:'电价',
                type:'line',
                data:[
                    {volist name="list" id="vo"}{$vo},{/volist}
                ],
                markPoint : {
                    data : [
                        {type : 'max', name: '最大值'},
                        {type : 'min', name: '最小值'}
                    ]
                },
                markLine : {
                    data : [
                        {type : 'average', name: '平均值'}
                    ]
                }
            },
            /*{
                name:'最低气温',
                type:'line',
                data:[1, -2, 2, 5, 3, 2, 0],
                markPoint : {
                    data : [
                        {type : 'max', name: '最大值'},
                        {type : 'min', name: '最小值'}
                    ]
                },
                markLine : {
                    data : [
                        {type : 'average', name : '平均值'}
                    ]
                }
            }*/
        ]
    };
</script>
